/*
 * adventdb.m
 */

#include "adventdb.h"

@implementation AdventDB

-(id)init
{
    self = [super init];

    sqlite3_initialize();
	printf("Using SQLite version %s\n", sqlite3_version);

    /* 
     * We don't want to change the underlying database,
     * so we use SQLITE_OPEN_READONLY
     */
	sqlite3_open_v2("advent.db", &db, SQLITE_OPEN_READONLY, 0);
    
    return self;
}

-(void)dealloc
{
    printf("Closing the database...\n");

	sqlite3_close(db);
	sqlite3_shutdown();

    [super dealloc];
}

@end

